<template>
  <a-card :bordered="false">


      <a-table
        bordered
        rowKey="id"
        size="middle"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="false"
        :loading="loading"
      >
        <span slot="exClass" slot-scope="text">
          <ak-ellipsis :value="text?text.join(';'):''" :length="150"/>
        </span>
      </a-table>
  </a-card>
</template>

<script>

  import { getAction } from '../../api/manage'
  import { baseLang } from '../../api/url'
  import AkEllipsis from '../../components/akfh/AkEllipsis'

  export default {
    name: "StatusCode",
    components: { AkEllipsis},
    description: '状态码',
    data() {
      return {

        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 120,
            align: "center",
            customRender: function (t, r, index) {
              return parseInt(index) + 1;
            }
          },
          {
            title: '状态码',
            align: "left",
            dataIndex: 'statusCode',
          },
          {
            title: '描述',
            align: "left",
            dataIndex: 'describe',
          },
          {
            title: '异常',
            align: "left",
            dataIndex: 'exClass',
            scopedSlots: { customRender: 'exClass' },
          },

        ],
        dataSource:[],
        loading:false
      }
    },
    mounted() {
      this.loading = true;
      getAction(baseLang.statusCode.list)
        .then(res=>{
          if(res.success){
            this.dataSource = res.result;
          }
        })
        .finally(()=>{
          this.loading = false;
        })
    }
  }
</script>
<style scoped>
  @import "../../assets/less/common.less";
</style>